<template>
    <div class="test">
        <MessageAreaIndex 
        title="MyMainTitle" 
        sub-title="MySubTitle"
        :is-list-loading="isListLoadingRef"
        :list="listRef"

        @submit="submitHandle"
        />
    </div>
</template>
<script setup lang='ts'>
import { onMounted, ref } from 'vue';
import MessageAreaIndex from './MessageAreaIndex.vue';
import { TypeApiCommentI } from '~@/api/apiTypes';
import { getComments } from '~@/api/blog';

const isListLoadingRef=ref(true);

const listRef=ref<TypeApiCommentI[]>([])

onMounted(async ()=>{
    listRef.value=(await getComments(1)).rows;
})
    ////#region defineXxx
    //defineOptions({
        //name:
    //});

    //const props=defineProps({
        //propA:{
            //type:String,
            //required:true
        //},
        //propB:{
            //type:Number,
            //default:1
        //},
        //propC:{
            //type:String as PropType<MyType>,
            //required:true
        //},
    //});

    //const emit = defineEmits<{
        //event1:[para1:number,para2:string],
        //event2:[para1:number,para2:string],
    //}>();
    ////#endregion

const submitHandle=(formData:any,callback:Function)=>{
    console.log('in submitHandle');
    console.log('formData',formData);
    callback('发布成功');
}
    
</script>
<style lang='less' scoped>
.test{
    height: 800px;
    overflow: auto;
}
</style>